package com.leecode;

import com.test.TreeNode;

/**
 * 翻转二叉树
 */
public class Leet226 {
	public static void main(String[] args) {

	}
	//100%,74%
	public TreeNode invertTree(TreeNode root) {
		if(root==null)return root;

		TreeNode temp=root.left;
		root.left=root.right;
		root.right=temp;
		invertTree(root.left);
		invertTree(root.right);
		return root;
	}
}
